3.83 \(\int \frac{\cot ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx\)

Optimal. Leaf size=107 \[ -\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{2 \csc ^5(c+d x)}{5 a^2 d}-\frac{4 \csc ^3(c+d x)}{3 a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{x}{a^2} \]

[Out]

-(x/a^2) - Cot[c + d*x]/(a^2*d) + Cot[c + d*x]^3/(3*a^2*d) - (2*Cot[c + d*x]^5)/(5*a^2*d) + (2*Csc[c + d*x])/(
a^2*d) - (4*Csc[c + d*x]^3)/(3*a^2*d) + (2*Csc[c + d*x]^5)/(5*a^2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.173748, antiderivative size = 107, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 8, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.381, Rules used = {3888, 3886, 3473, 8, 2606, 194, 2607, 30} \[ -\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{2 \csc ^5(c+d x)}{5 a^2 d}-\frac{4 \csc ^3(c+d x)}{3 a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{x}{a^2} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2/(a + a*Sec[c + d*x])^2,x]

[Out]

-(x/a^2) - Cot[c + d*x]/(a^2*d) + Cot[c + d*x]^3/(3*a^2*d) - (2*Cot[c + d*x]^5)/(5*a^2*d) + (2*Csc[c + d*x])/(
a^2*d) - (4*Csc[c + d*x]^3)/(3*a^2*d) + (2*Csc[c + d*x]^5)/(5*a^2*d)

Rule 3888

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rule 3886

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[ExpandI
ntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 194

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n)^p, x], x] /; FreeQ[{a, b}, x]
&& IGtQ[n, 0] && IGtQ[p, 0]

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps

\begin{align*} \int \frac{\cot ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx &=\frac{\int \cot ^6(c+d x) (-a+a \sec (c+d x))^2 \, dx}{a^4}\\ &=\frac{\int \left (a^2 \cot ^6(c+d x)-2 a^2 \cot ^5(c+d x) \csc (c+d x)+a^2 \cot ^4(c+d x) \csc ^2(c+d x)\right ) \, dx}{a^4}\\ &=\frac{\int \cot ^6(c+d x) \, dx}{a^2}+\frac{\int \cot ^4(c+d x) \csc ^2(c+d x) \, dx}{a^2}-\frac{2 \int \cot ^5(c+d x) \csc (c+d x) \, dx}{a^2}\\ &=-\frac{\cot ^5(c+d x)}{5 a^2 d}-\frac{\int \cot ^4(c+d x) \, dx}{a^2}+\frac{\operatorname{Subst}\left (\int x^4 \, dx,x,-\cot (c+d x)\right )}{a^2 d}+\frac{2 \operatorname{Subst}\left (\int \left (-1+x^2\right )^2 \, dx,x,\csc (c+d x)\right )}{a^2 d}\\ &=\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{\int \cot ^2(c+d x) \, dx}{a^2}+\frac{2 \operatorname{Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,\csc (c+d x)\right )}{a^2 d}\\ &=-\frac{\cot (c+d x)}{a^2 d}+\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{4 \csc ^3(c+d x)}{3 a^2 d}+\frac{2 \csc ^5(c+d x)}{5 a^2 d}-\frac{\int 1 \, dx}{a^2}\\ &=-\frac{x}{a^2}-\frac{\cot (c+d x)}{a^2 d}+\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{4 \csc ^3(c+d x)}{3 a^2 d}+\frac{2 \csc ^5(c+d x)}{5 a^2 d}\\ \end{align*}

Mathematica [A]  time = 1.34006, size = 149, normalized size = 1.39 \[ \frac{\sec ^2(c+d x) \left (-120 d x \cos ^4\left (\frac{1}{2} (c+d x)\right )+3 \tan \left (\frac{1}{2} (c+d x)\right )-31 \tan \left (\frac{c}{2}\right ) \cos ^2\left (\frac{1}{2} (c+d x)\right )-31 \sec \left (\frac{c}{2}\right ) \sin \left (\frac{d x}{2}\right ) \cos \left (\frac{1}{2} (c+d x)\right )+\sin \left (\frac{d x}{2}\right ) \cos ^3\left (\frac{1}{2} (c+d x)\right ) \left (15 \csc \left (\frac{c}{2}\right ) \cot \left (\frac{1}{2} (c+d x)\right )+193 \sec \left (\frac{c}{2}\right )\right )\right )}{30 a^2 d (\sec (c+d x)+1)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^2/(a + a*Sec[c + d*x])^2,x]

[Out]

(Sec[c + d*x]^2*(-120*d*x*Cos[(c + d*x)/2]^4 - 31*Cos[(c + d*x)/2]*Sec[c/2]*Sin[(d*x)/2] + Cos[(c + d*x)/2]^3*
(15*Cot[(c + d*x)/2]*Csc[c/2] + 193*Sec[c/2])*Sin[(d*x)/2] - 31*Cos[(c + d*x)/2]^2*Tan[c/2] + 3*Tan[(c + d*x)/
2]))/(30*a^2*d*(1 + Sec[c + d*x])^2)

________________________________________________________________________________________

Maple [A]  time = 0.062, size = 94, normalized size = 0.9 \begin{align*}{\frac{1}{40\,d{a}^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{5}}-{\frac{5}{24\,d{a}^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{3}}+{\frac{11}{8\,d{a}^{2}}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }-2\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{d{a}^{2}}}-{\frac{1}{8\,d{a}^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2/(a+a*sec(d*x+c))^2,x)

[Out]

1/40/d/a^2*tan(1/2*d*x+1/2*c)^5-5/24/d/a^2*tan(1/2*d*x+1/2*c)^3+11/8/d/a^2*tan(1/2*d*x+1/2*c)-2/d/a^2*arctan(t
an(1/2*d*x+1/2*c))-1/8/d/a^2/tan(1/2*d*x+1/2*c)

________________________________________________________________________________________

Maxima [A]  time = 1.73956, size = 153, normalized size = 1.43 \begin{align*} \frac{\frac{\frac{165 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac{25 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac{3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{2}} - \frac{240 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac{15 \,{\left (\cos \left (d x + c\right ) + 1\right )}}{a^{2} \sin \left (d x + c\right )}}{120 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

1/120*((165*sin(d*x + c)/(cos(d*x + c) + 1) - 25*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 3*sin(d*x + c)^5/(cos(d
*x + c) + 1)^5)/a^2 - 240*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a^2 - 15*(cos(d*x + c) + 1)/(a^2*sin(d*x + c
)))/d

________________________________________________________________________________________

Fricas [A]  time = 1.10047, size = 277, normalized size = 2.59 \begin{align*} -\frac{26 \, \cos \left (d x + c\right )^{3} + 22 \, \cos \left (d x + c\right )^{2} + 15 \,{\left (d x \cos \left (d x + c\right )^{2} + 2 \, d x \cos \left (d x + c\right ) + d x\right )} \sin \left (d x + c\right ) - 17 \, \cos \left (d x + c\right ) - 16}{15 \,{\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )} \sin \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/15*(26*cos(d*x + c)^3 + 22*cos(d*x + c)^2 + 15*(d*x*cos(d*x + c)^2 + 2*d*x*cos(d*x + c) + d*x)*sin(d*x + c)
 - 17*cos(d*x + c) - 16)/((a^2*d*cos(d*x + c)^2 + 2*a^2*d*cos(d*x + c) + a^2*d)*sin(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\cot ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec{\left (c + d x \right )} + 1}\, dx}{a^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2/(a+a*sec(d*x+c))**2,x)

[Out]

Integral(cot(c + d*x)**2/(sec(c + d*x)**2 + 2*sec(c + d*x) + 1), x)/a**2

________________________________________________________________________________________

Giac [A]  time = 1.39127, size = 113, normalized size = 1.06 \begin{align*} -\frac{\frac{120 \,{\left (d x + c\right )}}{a^{2}} + \frac{15}{a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )} - \frac{3 \, a^{8} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 25 \, a^{8} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 165 \, a^{8} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{a^{10}}}{120 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="giac")

[Out]

-1/120*(120*(d*x + c)/a^2 + 15/(a^2*tan(1/2*d*x + 1/2*c)) - (3*a^8*tan(1/2*d*x + 1/2*c)^5 - 25*a^8*tan(1/2*d*x
 + 1/2*c)^3 + 165*a^8*tan(1/2*d*x + 1/2*c))/a^10)/d